package com.sxz.sbs.module.order.presenter;

import com.sxz.sbs.app.App;
import com.sxz.sbs.module.order.mode.OrderGroupBean;
import com.sxz.sbs.module.order.mode.OrderhandleBean;
import com.sxz.sbs.module.order.view.OrderGroupView;
import com.sxz.sbs.module.order.view.OrderListView;
import com.sxz.sbs.rx.RxPresenter;
import com.sxz.sbs.rx.RxSubscriber;
import com.sxz.sbs.rx.RxUtil;

import java.util.HashMap;
import java.util.List;

/**
 * 订单状态P层
 * @author hp
 */
public class OrderGroupPresenter extends RxPresenter<OrderGroupView>{
    /**
     * @param map
     */
    public void getOrderGroup (final HashMap<String,Object> map) {
        addSubscribe(App.getInstance().getApi().getOrderGroup(map)
                .compose(RxUtil.<List<OrderGroupBean>>handleResult())
                .subscribeWith(new RxSubscriber<List<OrderGroupBean>>(mView,true){
                    @Override
                    public void onNext(List<OrderGroupBean> data) {
                        mView.onOrderGroupSuccess(data);
                    }
                })
        );
    }
}
